home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / as2db1 / frmrepla.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-01-07  |  7.4 KB  |  201 lines

  1. VERSION 2.00
  2. Begin Form frmReplaceMode 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Replace Mode"
  6.    ClientHeight    =   3870
  7.    ClientLeft      =   2430
  8.    ClientTop       =   2145
  9.    ClientWidth     =   4920
  10.    ControlBox      =   0   'False
  11.    Height          =   4275
  12.    Left            =   2370
  13.    LinkTopic       =   "Form3"
  14.    ScaleHeight     =   3870
  15.    ScaleWidth      =   4920
  16.    Top             =   1800
  17.    Width           =   5040
  18.    Begin CommandButton cmdCancel 
  19.       Cancel          =   -1  'True
  20.       Caption         =   "&Cancel"
  21.       Height          =   495
  22.       Left            =   2640
  23.       TabIndex        =   10
  24.       Top             =   3240
  25.       Width           =   855
  26.    End
  27.    Begin CommandButton cmdHelp 
  28.       Caption         =   "&Help"
  29.       Height          =   495
  30.       Left            =   1440
  31.       TabIndex        =   9
  32.       Top             =   3240
  33.       Width           =   855
  34.    End
  35.    Begin CommandButton cmdOK 
  36.       Caption         =   "&OK"
  37.       Default         =   -1  'True
  38.       Height          =   495
  39.       Left            =   3840
  40.       TabIndex        =   8
  41.       Top             =   3240
  42.       Width           =   855
  43.    End
  44.    Begin OptionButton optReplaceMode 
  45.       BackColor       =   &H00C0C0C0&
  46.       Caption         =   "&0 [[Delete old db, recreate db && table]]"
  47.       Height          =   255
  48.       Index           =   0
  49.       Left            =   240
  50.       TabIndex        =   0
  51.       Top             =   480
  52.       Width           =   4575
  53.    End
  54.    Begin OptionButton optReplaceMode 
  55.       BackColor       =   &H00C0C0C0&
  56.       Caption         =   "&1 [[Keep old db; recreate entire table]]"
  57.       Height          =   255
  58.       Index           =   1
  59.       Left            =   240
  60.       TabIndex        =   1
  61.       Top             =   840
  62.       Width           =   4575
  63.    End
  64.    Begin OptionButton optReplaceMode 
  65.       BackColor       =   &H00C0C0C0&
  66.       Caption         =   "&3 [[Mass delete && add]]"
  67.       Height          =   255
  68.       Index           =   3
  69.       Left            =   240
  70.       TabIndex        =   3
  71.       Top             =   2040
  72.       Width           =   4575
  73.    End
  74.    Begin OptionButton optReplaceMode 
  75.       BackColor       =   &H00C0C0C0&
  76.       Caption         =   "&4 [[Individual replace; if nomatch: add]]"
  77.       Height          =   255
  78.       Index           =   4
  79.       Left            =   240
  80.       TabIndex        =   4
  81.       Top             =   2400
  82.       Width           =   4575
  83.    End
  84.    Begin OptionButton optReplaceMode 
  85.       BackColor       =   &H00C0C0C0&
  86.       Caption         =   "&2 [[Keep old db; add new records to table]]"
  87.       Height          =   255
  88.       Index           =   2
  89.       Left            =   240
  90.       TabIndex        =   2
  91.       Top             =   1680
  92.       Width           =   4575
  93.    End
  94.    Begin OptionButton optReplaceMode 
  95.       BackColor       =   &H00C0C0C0&
  96.       Caption         =   "&5 [[Field update; if nomatch: log error]]"
  97.       Height          =   255
  98.       Index           =   5
  99.       Left            =   240
  100.       TabIndex        =   6
  101.       Top             =   2760
  102.       Width           =   4575
  103.    End
  104.    Begin Label Label1 
  105.       BackColor       =   &H00C0C0C0&
  106.       Caption         =   "DON'T retain old records:"
  107.       FontBold        =   -1  'True
  108.       FontItalic      =   -1  'True
  109.       FontName        =   "MS Sans Serif"
  110.       FontSize        =   9.75
  111.       FontStrikethru  =   0   'False
  112.       FontUnderline   =   0   'False
  113.       ForeColor       =   &H000000FF&
  114.       Height          =   255
  115.       Left            =   120
  116.       TabIndex        =   7
  117.       Top             =   120
  118.       Width           =   3495
  119.    End
  120.    Begin Label Label2 
  121.       BackColor       =   &H00C0C0C0&
  122.       Caption         =   "DO retain old records:"
  123.       FontBold        =   -1  'True
  124.       FontItalic      =   -1  'True
  125.       FontName        =   "MS Sans Serif"
  126.       FontSize        =   9.75
  127.       FontStrikethru  =   0   'False
  128.       FontUnderline   =   0   'False
  129.       ForeColor       =   &H000000FF&
  130.       Height          =   255
  131.       Left            =   120
  132.       TabIndex        =   5
  133.       Top             =   1320
  134.       Width           =   3135
  135.    End
  136. Option Explicit
  137. Dim modeSelected  'save from radio click event
  138. Sub cmdCancel_Click ()
  139.   Unload Me
  140. End Sub
  141. Sub cmdHelp_Click ()
  142.   Dim Msg
  143.   Msg = Msg & "MODE 0 will delete an entire existing MDB file, and all its "
  144.   Msg = Msg & "Tables.  The records are added to a new empty table in the db." & NL & NL
  145.   Msg = Msg & "MODE 1 will keep the existing MDB file, and all its " & NL
  146.   Msg = Msg & "Tables, except the destination table.  This table is" & NL
  147.   Msg = Msg & "entirely replaced by the new records." & NL & NL
  148.   Msg = Msg & "MODE 2 retains the database file, and all tables and all" & NL
  149.   Msg = Msg & "records in those tables.  It ADDS records to the existing" & NL
  150.   Msg = Msg & "destination table."
  151.   MsgBox Msg
  152.   Msg = "MODE 3: You can delete all records with some attribute " & NL
  153.   Msg = Msg & "from a table, and replace them with new ones. " & NL
  154.   Msg = Msg & "- Build your function Mode345Key to return the number" & NL
  155.   Msg = Msg & "   of the field (in the array gIOFld) " & NL
  156.   Msg = Msg & "- you get a chance to abort, showing the record count " & NL
  157.   Msg = Msg & "- if ok, SQL delete is used to delete the records " & NL
  158.   Msg = Msg & "- then all new records are added to the table. " & NL
  159.   Msg = Msg & "- NOTE: all records that get through PassFilter MUST" & NL
  160.   Msg = Msg & "   have the same attribute in this field, since only" & NL
  161.   Msg = Msg & "   the first one is checked!" & NL
  162.   Msg = Msg & "- no index is required since SQL is used to deal with" & NL
  163.   Msg = Msg & "   the replaced records."
  164.   MsgBox Msg
  165.   Msg = "MODE 4 & 5: These are for updating UNIQUELY INDEXED records in " & NL
  166.   Msg = Msg & "the destination table. " & NL & NL
  167.   Msg = Msg & "You must also complete the Functions Mode345Key and Mode45Key " & NL
  168.   Msg = Msg & "in your code module. " & NL
  169.   Msg = Msg & "- Mode345Key returns the field number in the gIOFld array" & NL
  170.   Msg = Msg & "- Mode45Key returns index name in the destination table. " & NL & NL
  171.   MsgBox Msg
  172.   Msg = "MODE 4: If NOMATCH is found to the index, the record is added to " & NL
  173.   Msg = Msg & "the file.  You can use this when you may be replacing an entire " & NL
  174.   Msg = Msg & "record, or adding an entire new record. " & NL & NL
  175.   Msg = Msg & "MODE 5: If NOMATCH is found to the index, the record is logged in " & NL
  176.   Msg = Msg & "the run log file.  You can use this when you are updating specific " & NL
  177.   Msg = Msg & "fields of existing unique records, and you want to be notified if a " & NL
  178.   Msg = Msg & "record does not exist.  Only the fields you are updating should be in " & NL
  179.   Msg = Msg & "the array gIOFld. " & NL
  180.   MsgBox Msg
  181. End Sub
  182. Sub cmdOK_Click ()
  183.   Form1!lblReplaceMode = ReplaceModes(modeSelected)
  184.   ReplaceMode = modeSelected
  185.   Unload Me
  186. End Sub
  187. Sub Form_Load ()
  188.   Dim i
  189.   optReplaceMode(ReplaceMode).Value = True
  190.   For i = 0 To UBound(ReplaceModes)
  191.     optReplaceMode(i).Caption = ReplaceModes(i)
  192.   Next
  193. End Sub
  194. Sub optReplaceMode_Click (Index As Integer)
  195.     If ProgramEdit = True Then
  196.         ProgramEdit = False
  197.         Exit Sub
  198.     End If
  199.     modeSelected = Index
  200. End Sub
  201.